<template>
  <div class="app-container page-home">
    <div class="page-home-container">
      <h3 class="page-home-container-title">选择流程进入</h3>
      <div class="page-home-container-flows">
        <flow-card
          v-for="flow in flows"
          class="flow-item"
          :flow="flow"
          :key="flow.title"
        />
      </div>
    </div>
  </div>
</template>

<script lang="ts">
import { defineComponent } from 'vue'
import FlowCard from '@/components/flow-card/index.vue'
import { useStore } from '@/store'

export default defineComponent({
  name: 'Home',
  components: { FlowCard },
  setup() {
    const store = useStore()
    return {
      flows: store.state.permission.flows
    }
  }
})
</script>

<style lang="scss" scoped>
.page-home {
  width: 100vw;
  height: 100vh;
  background: #f2f2f2;
  padding-top: 100px;
  box-sizing: border-box;
  &-container {
    width: 75%;
    min-height: 300px;
    margin: 0 auto;
    padding: 40px 40px 20px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 8px;
    &-title {
      margin: 0 0 30px;
      font-size: 32px;
      color: #4ab7bd;
      text-align: center;
      letter-spacing: 4px;
    }
    &-flows {
      display: flex;
      flex-flow: row wrap;
    }
    .flow-item {
      margin-bottom: 20px;
      margin-right: 20px;
    }
  }
}
</style>
